package vn.edu.fpt.xml.back.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Created by hiephn on 2014/04/27.
 */
@Component
public class XnConfiguration {

    @Value("${hibernate.connection.driver_class}")
    private String hibernateConnectionDriverClass;
    @Value("${hibernate.connection.url}")
    private String hibernateConnectionUrl;
    @Value("${hibernate.connection.username}")
    private String hibernateConnectionUsername;
    @Value("${hibernate.connection.password}")
    private String hibernateConnectionPassword;
    @Value("${hibernate.dialect}")
    private String hibernateDialect;
    @Value("${hibernate.connection.pool_size}")
    private int hibernateConnectionPoolSize;
    @Value("${hibernate.connection.autocommit}")
    private boolean hibernateConnectionAutocommit;
    @Value("${hibernate.transaction.flush_before_completion}")
    private boolean hibernateTransactionFlushBeforeCompletion;
    @Value("${hibernate.transaction.auto_close_session}")
    private boolean hibernateTransactionAutoCloseSession;
    @Value("${xn.cloud.back.engine.host}")
    private String xnCloudBackEngineHost;
    @Value("${xn.cloud.front.article_content.html}")
    private String xnCloudFrontArticleContentHtml;
    @Value("${xn.cloud.front.homepage_content.html}")
    private String xnCloudFrontHomepageContentHtml;

    public String getXnCloudFrontArticleContentHtml() {
        return xnCloudFrontArticleContentHtml;
    }

    public String getXnCloudFrontHomepageContentHtml() {
        return xnCloudFrontHomepageContentHtml;
    }

    public String getXnCloudBackEngineHost() {
        return xnCloudBackEngineHost;
    }

    public String getXnCloudBackEngineArticlePosterUrl() {
        return xnCloudBackEngineHost + "/news/poster/article";
    }

    public boolean isHibernateTransactionFlushBeforeCompletion() {
        return hibernateTransactionFlushBeforeCompletion;
    }

    public boolean isHibernateTransactionAutoCloseSession() {
        return hibernateTransactionAutoCloseSession;
    }

    public boolean isHibernateConnectionAutocommit() {
        return hibernateConnectionAutocommit;
    }

    public String getHibernateConnectionDriverClass() {
        return hibernateConnectionDriverClass;
    }

    public String getHibernateConnectionUrl() {
        return hibernateConnectionUrl;
    }

    public String getHibernateConnectionUsername() {
        return hibernateConnectionUsername;
    }

    public String getHibernateConnectionPassword() {
        return hibernateConnectionPassword;
    }

    public String getHibernateDialect() {
        return hibernateDialect;
    }

    public int getHibernateConnectionPoolSize() {
        return hibernateConnectionPoolSize;
    }
}
